import { PostApi, GetApiHad } from "../request/Index";
import type { ItitleAndcodequery } from "../types/index";

export interface Icustomer {
  id: String;
  title: String;
  phone: String;
  description: String;
}

enum Api {
  querycustomerListApi = "/api/customer/list",
  addorupdatecustomerApi = "/api/customer",
}

export async function querycustomerListApi(params: ItitleAndcodequery) {
  return GetApiHad(Api.querycustomerListApi, params);
}

//添加或者修改客户信息，Add or Update customer information
export async function addorupdatecustomerApi(type: String, params: Icustomer) {
  return PostApi(Api.addorupdatecustomerApi + `/${type}`, params);
}
